package turtle;

public class Viereck{
	protected double x, y;
	protected double w;
	protected double[] seiten;
	protected double[] winkel;
	
	public Viereck(double x, double y, double abosten,
			double a, double beta,
			double b, double gamma,
			double c){
		this.x=x;
		this.y=y;
		this.w=abosten;
		seiten=new double[]{a, b, c};
		winkel=new double[]{beta, gamma};
	}

	public Viereck(double x, double y, double w, double a, double b){
		this(x, y, w, a, 90, b, 90, a);
	}

	public void zeichne(Turtle t){
		t.moveTo(x, y);
		t.turnTo(w);
		t.line(seiten[0]);
		for(int i=0; i<2; i++){
      t.turn(180-winkel[i]);
			t.line(seiten[i+1]);
		}
		t.lineTo(x, y);
	}

	public static void main(String[] args) throws Exception{
		Turtle susi=new Turtle();
		Viereck v=new Viereck(0,0,20, 70, 100);
		v.zeichne(susi);
		susi.show();
	}
}